package com.cctv.haierstore.product.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;

import com.cctv.common.vaild.addGroup;
import com.cctv.common.vaild.listValue;
import com.cctv.common.vaild.updateGroup;
import lombok.Data;
import org.hibernate.validator.constraints.URL;

import javax.validation.constraints.*;

/**
 * 品牌
 * 
 * @author huayi
 * @email 1582991824@qq.com
 * @date 2021-07-05 11:14:31
 */
@Data
@TableName("pms_brand")
public class BrandEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * 品牌id
	 */
	@TableId
	@Null(message = "新增品牌id必须为null" ,groups = {addGroup.class})
	@NotNull(message = "修改品牌id必须非空", groups = {updateGroup.class})
	private Long brandId;
	/**
	 * 品牌名
	 */
	@NotBlank(message = "品牌名称不能为空",groups = {addGroup.class,updateGroup.class})
	private String name;
	/**
	 * 品牌logo地址
	 */
//    @NotEmpty
//    @URL(message = "logo必须是一个合法的url地址")
	private String logo;
	/**
	 * 介绍
	 */
	private String descript;
	/**
	 * 显示状态[0-不显示；1-显示]
	 */
	@listValue(vals = {0,1},groups = {addGroup.class})
	private Integer showStatus;
	/**
	 * 检索首字母
	 */
    @NotEmpty
    @Pattern(regexp = "/^[a-zA-Z]$/",message = "检索首字母必须是一个字母")
	private String firstLetter;
	/**
	 * 排序
	 */
	@NotNull
	@Min(value = 0,message = "排序必须大于等于0")
	private Integer sort;

}
